package com.blog.study.study9;

import java.util.Random;

/**
 * 〈Java实现跳跃表〉<br>
 *
 * @author 未绪
 * @time 2018/1/9 16:03
 */
public class SkipList {

    public SkipListNode header;     //记录头结点
    public SkipListNode tail;       //记录尾节点

    public int level;               //记录层数
    public int length;              //记录节点的数目

    public Random random;           //利用随机数来确定需不需要增加层数

    public SkipList(){

        header=new SkipListNode();
        tail=new SkipListNode();
        header.right=tail;
        tail.left=header;
        length=0;
        level=0;
        random=new Random();
    }

    public boolean isEmpty(){
        return length==0;
    }

    public SkipListNode find(Object k){
        SkipListNode node=header;


//        while (true){
//
//
//            while(node.right.key)
//
//        }

        return node;
    }


}
